{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/containers/DialogInput.tsx\",\n  _s = $RefreshSig$();\nimport React from \"react\";\nimport { DialogInput as DialogInputComponent } from \"../components\";\nimport { Context } from \"../index\";\nimport { observer } from \"mobx-react-lite\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst DialogInput = _ref => {\n  _s();\n  let {\n    chat\n  } = _ref;\n  const {\n    store\n  } = React.useContext(Context);\n  const [value, setValue] = React.useState(false);\n  const [textField, setTextField] = React.useState('');\n  const [emojiPickerVisible, setEmojiPickerVisible] = React.useState(false);\n  const maxSizeMessage = 500;\n  React.useEffect(() => {\n    if (textField.length > 0) {\n      setValue(true);\n    } else {\n      setValue(false);\n    }\n  }, [textField]);\n  const toggleEmojiPicker = () => {\n    setEmojiPickerVisible(!emojiPickerVisible);\n  };\n  const uploadDocumentHandler = React.useCallback(e => {\n    let files;\n    if (e.target.files) {\n      const file = e.target.files[0];\n      console.log(e.target.files);\n    }\n    e.target.value = '';\n  }, [store]);\n  return /*#__PURE__*/_jsxDEV(DialogInputComponent, {\n    toggleEmojiPicker: toggleEmojiPicker,\n    emojiPickerVisible: emojiPickerVisible,\n    value: value,\n    textField: textField,\n    setTextField: setTextField,\n    maxSizeMessage: maxSizeMessage,\n    uploadDocumentHandler: uploadDocumentHandler\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 37,\n    columnNumber: 9\n  }, this);\n};\n_s(DialogInput, \"DqnSRKwHvr/n50L2XPq8qDT31gk=\");\n_c = DialogInput;\nexport default _c2 = observer(DialogInput);\nvar _c, _c2;\n$RefreshReg$(_c, \"DialogInput\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","DialogInput","DialogInputComponent","Context","observer","chat","store","useContext","value","setValue","useState","textField","setTextField","emojiPickerVisible","setEmojiPickerVisible","maxSizeMessage","useEffect","length","toggleEmojiPicker","uploadDocumentHandler","useCallback","e","files","target","file","console","log"],"sources":["/data/messenger.client/src/containers/DialogInput.tsx"],"sourcesContent":["import React from \"react\";\nimport {DialogInputContainerProps} from \"../models/props/DialogInputContainerProps\";\nimport {DialogInput as DialogInputComponent} from \"../components\";\nimport {Context} from \"../index\";\nimport {observer} from \"mobx-react-lite\";\n\nconst DialogInput: React.FC<DialogInputContainerProps> = ({chat}) => {\n    const {store} = React.useContext(Context);\n    const [value, setValue] = React.useState<boolean>(false);\n    const [textField, setTextField] = React.useState<string>('');\n    const [emojiPickerVisible, setEmojiPickerVisible] = React.useState<boolean>(false);\n\n    const maxSizeMessage: number = 500;\n\n    React.useEffect(() => {\n        if (textField.length > 0) {\n            setValue(true);\n        } else {\n            setValue(false);\n        }\n    }, [textField]);\n\n    const toggleEmojiPicker = () => {\n        setEmojiPickerVisible(!emojiPickerVisible);\n    }\n\n    const uploadDocumentHandler = React.useCallback( (e: React.ChangeEvent<HTMLInputElement>) => {\n        let files: File[];\n        if (e.target.files) {\n            const file: File = e.target.files[0];\n            console.log(e.target.files);\n        }\n        e.target.value = '';\n    }, [store]);\n\n    return (\n        <DialogInputComponent\n            toggleEmojiPicker={toggleEmojiPicker}\n            emojiPickerVisible={emojiPickerVisible}\n            value={value}\n            textField={textField}\n            setTextField={setTextField}\n            maxSizeMessage={maxSizeMessage}\n            uploadDocumentHandler={uploadDocumentHandler}\n        />\n    );\n}\n\nexport default observer(DialogInput);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAAQC,WAAW,IAAIC,oBAAoB,QAAO,eAAe;AACjE,SAAQC,OAAO,QAAO,UAAU;AAChC,SAAQC,QAAQ,QAAO,iBAAiB;AAAC;AAEzC,MAAMH,WAAgD,GAAG,QAAY;EAAA;EAAA,IAAX;IAACI;EAAI,CAAC;EAC5D,MAAM;IAACC;EAAK,CAAC,GAAGN,KAAK,CAACO,UAAU,CAACJ,OAAO,CAAC;EACzC,MAAM,CAACK,KAAK,EAAEC,QAAQ,CAAC,GAAGT,KAAK,CAACU,QAAQ,CAA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